package org.example.netty.test.nio.netty.chat.common;

/**
 * @author zp
 * @version 1.0
 * @description: 系统消息类型
 * @date 2023/4/7 19:38
 * 开头含义
 * 0000 成功发送 无特殊含义
 * 10 注册
 * 11 登入
 * 12 单聊
 * 13 群聊
 *
 * 99 错误
 * 9999 系统未知错误
 */
public enum SystemMessageType {
    SUCCESS("0000","系统消息发送成功"),
    REGISTER_SUCCESS("1000","注册账号成功"),
    LOGIN_SUCCESS("1100","登入成功"),
    JOIN_USER_SUCCESS("1200","加入私聊成功"),
    OUT_USER_SUCCESS("1299","退出私聊成功"),
    CREATE_GROUP_SUCCESS("1300","创建群聊成功"),
    OUT_GROUP_SUCCESS("1399","退出群聊成功"),
    JOIN_GROUP_SUCCESS("1301","加入群聊成功"),
    LOG_OUT_SUCCESS("1199","登出成功"),


    REGISTER_USER_NAME_FAIL("9901","用户名重复 请重新输入"),
    LOGIN_USER_FAIL("9902","用户名密码错误或者未注册，请重新输入或者注册"),
    NO_LOGIN_USER_FAIL("9903","用户请先登入"),
    JOIN_GROUP_FAIL("9904","加入群聊错误，已经在群聊请勿重复加入群聊"),
    CREATE_NAME_JOIN_GROUP_FAIL("9905","创建群聊错误，群聊名称重复无法创建"),

    LOG_OUT_FAIL("9906","退出登入错误，未登入无法登出"),
    LOG_IN_REPEAT_FAIL("9907","账户已经登入，请勿重复登入，请先退出后在登入"),
    CREATE_NAME_JOIN_GROUP_NAME_LIST_FAIL("9908","创建群聊错误，加入列表错误"),
    CREATE_NAME_JOIN_GROUP_REPEAT_NAME_LIST_FAIL("9909","创建群聊错误，自己重复加入群聊"),
    SEND_USER_CHAT_FAIL("9910","发送私聊消息失败，对方未加入私聊"),
    OUT_GROUP_FAIL("9911","退出群聊失败群聊不存在！！！"),
    FAIL("9999","系统错误");
    private String code;
    private String message;

    SystemMessageType(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
